package com.mastercard.labs

class Merchant {

	public enum Status {ACTIVE,INACTIVE}
	
	String name
	Country country
	String logo
	List categories
	String contact
	String address
	String description
	Status status
	Boolean deleled = Boolean.valueOf(false)
	
	static constraints = {
		name blank:false, unique: true, maxSize: 100
		country nullable: false
		contact blank:false, size: 8..20, matches: '^(\\+)?\\d{8,20}$'
		address nullable: true, maxSize: 255 
		categories nullable: false
		logo nullable: true, url: true, maxSize: 255
		description nullable: true, maxSize: 255
		status nullable: false
	}
	
	static hasMany=[categories:Category]
	
	String toString(){
		return name
	}
}
